Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-18.0] VReplication: Fix vtctldclient SwitchReads related bugs and move the TestBasicV2Workflows e2e test to vtctldclient (#15579) #15583

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

vitess-bot[bot]
Copy link
Contributor

@vitess-bot vitess-bot bot commented Mar 27, 2024

Description

This is a backport of #15579

Fixes: #15594

Copy link
Contributor Author

vitess-bot bot commented Mar 27, 2024

Hello @mattlord, there are conflicts in this backport.

Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually.

Make sure you replace origin by the name of the vitessio/vitess remote

git fetch --all
gh pr checkout 15583 -R vitessio/vitess
git reset --hard origin/release-18.0
git cherry-pick -m 1 df1285ca4c695e6e349d70202abbfe65725fcce0

Copy link
Contributor Author

vitess-bot bot commented Mar 27, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord removed the Skip CI Skip CI actions from running label Mar 29, 2024
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord marked this pull request as ready for review March 29, 2024 04:37
@deepthi deepthi added NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request labels Mar 29, 2024
@deepthi
Copy link
Member

deepthi commented Mar 29, 2024

I can't understand why these changes are needed without an issue that describes the bugs you found and are trying to fix.
Especially because we are backporting, it will be good to document the specific error/bug. I understand that some of the changes are for tests which is fine, we just need to call the actual production bug out.
While the commentary on the original PR is helpful in understanding how it came about, it should be amended with a link to the issue as well. Since that has already been merged I attached the description label to this PR instead.

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See prior comment

@mattlord mattlord added NeedsIssue A linked issue is missing for this Pull Request NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request labels Mar 29, 2024
@mattlord
Copy link
Contributor

mattlord commented Mar 29, 2024

I can't understand why these changes are needed without an issue that describes the bugs you found and are trying to fix.
Especially because we are backporting, it will be good to document the specific error/bug. I understand that some of the changes are for tests which is fine, we just need to call the actual production bug out.
While the commentary on the original PR is helpful in understanding how it came about, it should be amended with a link to the issue as well. Since that has already been merged I attached the description label to this PR instead.

Yeah, it's a bit odd. Sorry about that. I'll create 1 or 2 issues and link them in all of the related PRs, including this one. There were two general bugs, both related to switchReads:

  1. The --cells flag value was not getting passed through which is needed when switching reads in a subset of cells
    • When the cells value in the request was empty, we were using the cells specified in the workflow Create (used for selecting tablets) — when it should remain empty (meaning switch reads in all cells)
  2. For switchShardReads were were incorrectly managing the direction and its relationship to the source and target — when the source and target, based on the direction, are already setup when building the traffic switcher in the vtctldclient implementation — and thus SwitchTraffic/ReverseTraffic for Reshard did not work correctly

The other things were minor changes/improvements related to the code during the investigation. But these were pretty significant vtctldclient only bugs and I wanted to get them fixed ASAP, and also why it was important to follow through and increase the e2e testing of the vtctldclient implementation.

@mattlord mattlord removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request labels Mar 29, 2024
@mattlord mattlord requested a review from deepthi March 29, 2024 15:51
Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fixes 💯
Thank you for writing up the original issues, that made it easy to review this PR and spot the bug fixes.

@@ -213,7 +213,7 @@ func TestFile(t *testing.T) {
logger.Send(&logMessage{"test 2"})

// Allow time for propagation
time.Sleep(10 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, I assume 10 ms was too slow? These sleeps in CI have always been a bit of a headache.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had seen it flake.

@@ -670,6 +670,7 @@ func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspac
Binary: "vttablet",
FileToLogQueries: path.Join(tmpDirectory, fmt.Sprintf("/vt_%010d_querylog.txt", tabletUID)),
Directory: path.Join(os.Getenv("VTDATAROOT"), fmt.Sprintf("/vt_%010d", tabletUID)),
Cell: cell,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is a pretty big miss.

@@ -63,7 +63,7 @@ func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *ta
}
// Use the local cell if none are specified.
if len(req.Cells) == 0 || strings.TrimSpace(req.Cells[0]) == "" {
req.Cells = append(req.Cells, tm.Tablet().Alias.Cell)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♀️

@deepthi deepthi merged commit 69ed3c9 into release-18.0 Mar 29, 2024
205 of 211 checks passed
@deepthi deepthi deleted the backport-15579-to-release-18.0 branch March 29, 2024 16:58
@mattlord mattlord changed the title [release-18.0] VReplication: Move the Reshard v2 workflow to vtctldclient (#15579) [release-18.0] VReplication: Fix vtctldclient SwitchReads related bugs and move the TestBasicV2Workflows e2e test to vtctldclient (#15579) Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants